package USB;

public class Computer {

    public void poweropen() {
        System.out.println("打开电脑");
    }

    public void powerclose() {
        System.out.println("关闭电脑");
    }

    public void useUSB(USB usb) {
        usb.openDevice();
        if(usb instanceof Mouse) {
            Mouse mouse1 = (Mouse) usb;
            mouse1.Click();
        } else if(usb instanceof KeyBoard) {
            KeyBoard keyBoard1 = (KeyBoard) usb;
            keyBoard1.Input();
        }
        usb.closeDevice();
    }

}
